<html>
<#include "../common/header.ftl">

<body>
<div id="wrapper" class="toggled">

<#--边栏sidebar-->
<#include "../admin/nav.ftl">

<#--主要内容content-->
    <div id="page-content-wrapper">
        <div class="container-fluid">
            <div class="row clearfix">
                <div class="col-md-12 column">
                    <form role="form" method="post" action="/admin/school/save">
                        <div class="form-group">
                            <label>名字</label>
                            <input name="siteName" type="text" class="form-control" value="${(siteInfo.siteName)!''}"/>
                        </div>

                        <div class="form-group">
                            <label>坐标</label>
                            <input name="address" type="text" class="form-control" value="${(siteInfo.address)!''}"/>
                        </div>
                        <div class="form-group">
                            <label>账号</label>
                             <#if (siteInfo.id)??  >
                                    <input name="account" type="text"  readonly  class="form-control" value="${(siteInfo.account)!''}"/>
                             <#else>
                                   <input name="account" type="text"   class="form-control" value="${(siteInfo.account)!''}"/>
                             </#if>

                        </div>

                        <div class="form-group m-form__group">
                            <label for="fullAddress">
                                酒店地址选择
                            </label>
                            <div class="row">
                                <div class="col-md-5"><input type="text" class="form-control m-input"
                                                             id="pro-city-county" name="pro-city-county"
                                                             readonly placeholder="省市区" maxlength="255"
                                                             style="background-color: #c6c8ca"></div>
                                <div class="col-md-7"><input type="text" class="form-control m-input"
                                                             id="address" name="fullAddress"
                                                             placeholder="详细地址" maxlength="255"  value="${(siteInfo.fullAddress)!''}" ></div>
                            </div>

                            <input type="hidden" name="lng" value="${(siteInfo.lng)!''}">
                            <input type="hidden" name="lat" value="${(siteInfo.lat)!''}">
                            <input type="hidden" name="proId" value="${(siteInfo.proId)!''}">
                            <input type="hidden" name="proName" value="${(siteInfo.proName)!''}">
                            <input type="hidden" name="cityId" value="${(siteInfo.cityId)!''}">
                            <input type="hidden" name="cityName" value="${(siteInfo.cityName)!''}">
                            <input type="hidden" name="countyId" value="${(siteInfo.countyId)!''}">
                            <input type="hidden" name="countyName" value="${(siteInfo.countyName)!''}"">

                            <div id="mapContainer">
                                <iframe width="100%" frameborder="0" height="400" src=" /admin/school/map"></iframe>
                            </div>
                        </div>

                        <input hidden type="text" name="id" value="${(siteInfo.id)!''}">
                        <button type="submit" class="btn btn-default">提交</button>
                    </form>
                </div>
            </div>
        </div>
    </div>

</div>
<script>
    function geocoder_CallBack(data, lnglatXY) {
        var address = data.regeocode.formattedAddress;
        var province = data.regeocode.addressComponent.province; //	String	所在省
        var city = data.regeocode.addressComponent.city; //String	所在城市hotelId
        var citycode = data.regeocode.addressComponent.citycode; //	String	所在城市编码
        var district = data.regeocode.addressComponent.district; //	String	所在区
        var adcode = data.regeocode.addressComponent.adcode; //	String	所在区域编码
        var township = data.regeocode.addressComponent.township; //	String	所在乡镇
        var street = data.regeocode.addressComponent.street; //	String	所在街道
        var streetNumber = data.regeocode.addressComponent.streetNumber; //	String	门牌号
        var neighborhood = data.regeocode.addressComponent.neighborhood; //	String	所在社区
        var neighborhoodType = data.regeocode.addressComponent.neighborhoodType; //	String	社区类型
        var building = data.regeocode.addressComponent.building; //	String	所在楼/大厦
        var buildingType = data.regeocode.addressComponent.buildingType; //	String	楼类型
        var businessAreas = data.regeocode.addressComponent.businessAreas; //	Array.<BusinessArea>	仅逆地理编码时返回，所属商圈信息
        var longitude = lnglatXY[0];
        var latitude = lnglatXY[1];




        $("input[name='lng']").val(longitude);
        $("input[name='lat']").val(latitude);
        $("input[name='proName']").val(province);
        $("input[name='cityName']").val(city);

        $("input[name='proId']").val(citycode);
        $("input[name='cityId']").val(adcode);
        $("input[name='countyId']").val(adcode);
        $("input[name='countyName']").val(district);
       // $("input[name='address']").val(address);
        $("input[name='fullAddress']").val(address);
        $("input[name='address']").val(address);
        $("input[name='pro-city-county']").val(province+city+district);




    }

</script>

</body>
</html>